import random

# 人物和对应语音的映射关系
# 结构: {人物名称: {"voices": [语音列表], "description": 人物描述}}
AVATAR_VOICE_MAP = {
    "Dora": {
        "voices": [
            "Sofia Brazil - Friendly",
            "Pedro Brazil - Energetic",
            "Mariana Brazil - Enthusiastic"
        ],
        "description": "充满活力和热情的足球运动员，年轻有朝气，文案风格应积极向上，富有运动激情"
    },
    "John": {
        "voices": [
            "John - Friendly",
            "John - Energetic",
            "John - Enthusiastic"
        ],
        "description": "充满活力和热情的John，年轻有朝气，文案风格应积极向上，富有运动激情"
    },
    "Tim": {
        "voices": [
            "Tim - Friendly",
            "Tim - Energetic",
            "Tim - Enthusiastic"
        ],
        "description": "充满活力和热情的Tim，年轻有朝气，文案风格应积极向上，富有运动激情"
    }
}

# 文案库，按照不同人物类型分类
# 结构: {人物类型: [文案列表]}
SCRIPTS = {
    "Dora": [
        "Olá pessoal! Hoje quero falar sobre o nosso novo clube de futebol que está crescendo rapidamente. Se você é apaixonado por futebol, junte-se a nós! Estamos sempre buscando novos membros e torcedores para apoiar nosso time. Não perca a chance de fazer parte dessa família incrível e acompanhar nossos jogos emocionantes. Siga-nos e fique por dentro de todas as novidades!",
        "E aí galera do futebol! Temos uma novidade empolgante sobre nosso clube em ascensão. Se você ama emoção em campo, este é o seu lugar! Estamos sempre em busca de novos talentos e torcedores apaixonados. Não deixe de ser parte desta incrível jornada rumo à glória. Junte-se a nós hoje mesmo!",
        "Oi torcedores! Quero compartilhar o crescimento impressionante do nosso clube de futebol. Se o seu coração bate mais forte com a bola rolando, temos um convite especial para você. Venha fazer parte desta família que respira paixão pelo esporte. Compartilhe nosso sonho e torça com a gente!",
        "Amigos do futebol! Nosso clube está vivendo um momento especial de crescimento e conquistas. Se você sente a emoção dos jogos e quer fazer parte de algo maior, este é o seu momento! Estamos sempre abertos a novos membros e fãs dedicados. Faça parte da nossa história e venha vibrar com a gente!",
        "Fãs do esporte! Estamos expandindo nosso clube de futebol e buscando pessoas que compartilham nossa paixão pelo jogo. Se você vive pelos gols e vibra com cada partida, queremos você conosco! Não perca tempo, venha fazer parte desta família que ama o futebol de verdade!",
        "Jogadores e amantes do futebol! Nosso time está em plena evolução e precisamos da sua energia para continuar crescendo. Se você tem paixão pelo esporte e quer fazer parte de uma equipe que respira futebol, este é o seu momento. Junte-se a nós e faça história nesse clube que só cresce!",
        "Torcedores apaixonados! Estamos construindo algo especial aqui no nosso clube de futebol. Se você sonha em ver nosso time brilhar nas competições, queremos você conosco! Estamos sempre buscando novos membros e fãs dedicados. Venha fazer parte dessa família que vive de coração e alma o nosso esporte!",
        "Guerreiros do gramado! Nosso clube está em ascensão e precisamos de guerreiros como você para continuar essa jornada. Se você tem paixão, determinação e quer fazer parte de algo grandioso, junte-se a nós! Estamos sempre em busca de novos talentos e torcedores comprometidos."
    ],
    "John": [
        "In this rapidly evolving business landscape, strategic thinking and decisive action are more crucial than ever. Our company is positioned to lead the market with innovative solutions that drive sustainable growth. We understand that success requires not just vision, but also the execution excellence that sets industry leaders apart from the competition.",
        "Effective leadership in today's complex market demands a clear understanding of both challenges and opportunities. Our organization is committed to delivering value through strategic partnerships, operational excellence, and continuous innovation. We believe that sustainable success comes from building strong foundations and adapting to change with confidence.",
        "As we navigate through uncertain economic times, our focus remains firmly on creating long-term value for all stakeholders. Our approach combines proven methodologies with forward-thinking strategies, ensuring that we not only meet current demands but also anticipate future needs. Excellence in business is not about quick wins, but about consistent, sustainable performance.",
        "Modern enterprises require visionary leadership combined with pragmatic execution. Our company philosophy centers on building enduring relationships with clients, partners, and employees. Through strategic investments in technology and talent, we're creating a robust platform for continued growth in an increasingly competitive marketplace.",
        "Success in today's business environment demands a balance between innovation and stability. Our organization has consistently delivered results by focusing on core competencies while exploring new opportunities. We believe in measured growth, risk management, and building a culture of accountability that drives performance at every level.",
        "Strategic business transformation requires a holistic approach that aligns vision with execution. Our methodology focuses on identifying key growth drivers while maintaining operational efficiency. We understand that sustainable competitive advantage comes from continuous adaptation and the ability to leverage emerging opportunities in dynamic markets.",
        "Leadership excellence in the contemporary business world demands both analytical rigor and creative thinking. Our organization thrives by combining data-driven decision making with innovative approaches to problem-solving. We are committed to fostering an environment where strategic initiatives translate into measurable results and long-term value creation.",
        "In today's interconnected global economy, business success requires a multifaceted approach that encompasses innovation, efficiency, and stakeholder engagement. Our company distinguishes itself through purposeful leadership, strategic foresight, and relentless execution. We are dedicated to building sustainable competitive advantages that drive enduring success."
    ],
    "Tim": [
        "Technology continues to reshape our world at an unprecedented pace, creating new possibilities and challenges. Our latest innovations focus on solving real-world problems through elegant technical solutions. By combining cutting-edge research with practical implementation, we're building systems that not only perform exceptionally but also adapt to future requirements.",
        "In the rapidly evolving tech landscape, staying ahead requires constant learning and adaptation. Our approach emphasizes robust architecture, scalable solutions, and user-centric design. Whether you're implementing a new system or optimizing existing infrastructure, understanding the fundamentals remains crucial to achieving long-term success.",
        "The future of technology lies in seamless integration between human needs and digital capabilities. Our development philosophy centers on creating intuitive, powerful tools that enhance productivity without sacrificing security or reliability. Through careful planning and iterative improvement, we build solutions that stand the test of time.",
        "Modern software development demands a balance between innovation and stability. Our methodologies incorporate agile practices with proven engineering principles to deliver high-quality results. From initial concept to deployment and maintenance, every phase of the development lifecycle requires attention to detail and commitment to excellence.",
        "As we advance into an increasingly connected world, the importance of secure, efficient technology solutions cannot be overstated. Our team focuses on creating robust systems that protect user data while providing exceptional performance. Through continuous monitoring, testing, and optimization, we ensure our solutions meet the highest standards of quality and reliability.",
        "Digital transformation in today's competitive environment requires both technical expertise and strategic vision. Our solutions are designed to bridge the gap between complex technological capabilities and practical business needs. By focusing on usability, scalability, and security, we create technology that empowers organizations to achieve their goals.",
        "The intersection of artificial intelligence and practical application presents unprecedented opportunities for innovation. Our approach combines rigorous engineering practices with creative problem-solving to develop solutions that not only meet current demands but also anticipate future challenges. We believe in building technology that adapts and evolves with changing requirements.",
        "Effective technology implementation requires a deep understanding of both technical complexities and human factors. Our development process emphasizes collaboration, iterative improvement, and user feedback to create solutions that truly serve their intended purpose. Through careful attention to architecture and design, we build systems that are both powerful and intuitive."
    ],
    "Lifestyle Coach": [
        "Your journey to a better life starts with small, consistent steps taken every day. Success isn't about dramatic changes overnight, but about building sustainable habits that compound over time. Each positive choice you make creates momentum for even greater achievements. Remember, the path to transformation is paved with patience, dedication, and self-compassion.",
        "Personal growth happens in the space between comfort and challenge. When you're willing to step outside your familiar boundaries, that's when real change begins. Don't wait for the perfect moment or ideal conditions. Start where you are, with what you have, and trust in your ability to develop and improve. Your potential is greater than you realize.",
        "Creating the life you desire requires intentional action aligned with your deepest values. Take time to reflect on what truly matters to you, then design your daily choices around those priorities. Remember that setbacks are not failures, but learning opportunities. Progress is rarely linear, but with persistence and self-kindness, you'll move closer to your goals each day.",
        "The quality of your life is directly proportional to the quality of your relationships, both with others and with yourself. Cultivate compassion, practice gratitude, and invest time in meaningful connections. When you treat yourself with the same kindness you'd show a good friend, you create the foundation for lasting happiness and fulfillment.",
        "True transformation begins with self-awareness and the courage to make different choices. Pay attention to your thoughts, emotions, and behaviors without judgment. When you notice patterns that no longer serve you, gently redirect your energy toward more positive alternatives. Growth is a journey, not a destination, and every step forward is worth celebrating.",
        "Living authentically requires the courage to honor your true self while respecting others. Your journey is unique, and comparing yourself to others only diminishes your own progress. Focus on your personal growth, celebrate your victories, and learn from your challenges. The most important relationship you'll ever have is the one with yourself.",
        "Change begins the moment you decide to take responsibility for your life. Rather than waiting for circumstances to shift, focus on what you can control: your thoughts, actions, and responses. Every day presents new opportunities to make choices that align with your values and vision. Progress may be gradual, but it's always meaningful.",
        "Your well-being is a holistic concept that encompasses physical, emotional, mental, and spiritual health. Nurturing each aspect creates a foundation for lasting fulfillment. Practice self-care not as a luxury, but as a necessity. When you prioritize your health and happiness, you're better equipped to contribute positively to the world around you."
    ],
    "News Anchor": [
        "Breaking news tonight: Markets reach all-time highs as economic recovery continues to gain momentum. Federal reports show unemployment dropping to its lowest levels in over a decade, while consumer confidence indices reflect growing optimism about future prospects. International trade agreements announced this week are expected to boost economic activity across multiple sectors.",
        "In today's top stories: A groundbreaking medical research breakthrough offers new hope for patients with chronic conditions. Meanwhile, renewable energy initiatives continue to exceed projections, with solar and wind power generation reaching record levels. City council meetings today addressed infrastructure improvements and community development projects.",
        "Tonight's headlines: Technology companies unveil innovative solutions designed to address climate change challenges. Educational institutions report increased enrollment and improved graduation rates following curriculum enhancements. Local businesses celebrate a successful quarter, with small enterprise growth outpacing national averages for the third consecutive month.",
        "Today's major developments include: Government officials announce new policies aimed at improving healthcare accessibility. Transportation authorities reveal plans for expanded public transit systems designed to reduce urban congestion. Environmental protection agencies report positive results from recent conservation initiatives and clean energy adoption programs.",
        "Current affairs update: International diplomatic efforts show promising progress in resolving longstanding trade disputes. Scientific communities celebrate significant advances in artificial intelligence research with potential applications across multiple industries. Community organizations report successful fundraising campaigns supporting local social services and educational programs.",
        "Evening news summary: Stock markets show continued resilience amid global economic uncertainties. Healthcare systems report improved patient outcomes following implementation of new treatment protocols. Educational initiatives in local districts demonstrate measurable progress in student achievement and engagement across diverse learning environments.",
        "Latest updates: Climate scientists announce significant findings regarding renewable energy efficiency improvements. Transportation departments unveil plans for smart city infrastructure projects designed to enhance mobility and reduce environmental impact. Cultural institutions celebrate record attendance and community engagement in arts and educational programming.",
        "News digest: Economic indicators point to sustained growth in key sectors including technology and renewable energy. Public health officials report positive trends in vaccination coverage and disease prevention initiatives. Educational institutions highlight innovative approaches to learning that are showing promising results in student outcomes and engagement."
    ],
    "Fitness Trainer": [
        "Your body is capable of incredible things, but it needs your commitment and consistency to unlock its full potential. Every workout you skip is a victory you give away to your excuses. Every session you complete is a step toward the stronger, healthier version of yourself that you deserve to become. The choice is yours, and the time is now!",
        "Strength isn't just about muscle mass or perfect form - it's about mental toughness, discipline, and the willingness to push through when things get challenging. The moment you want to quit is often the moment you're making the greatest progress. Embrace the burn, celebrate small victories, and remember that consistency always beats perfection.",
        "Fitness transformation is 70% nutrition and 30% exercise - but 100% mindset. You can do all the workouts in the world, but if your nutrition doesn't support your goals, you'll struggle to see results. Focus on building sustainable habits rather than following extreme diets. Progress takes time, but it's worth the wait.",
        "Don't wait for motivation to strike - create momentum through action. Some days you'll feel like a champion, others you'll need to push through resistance. Both types of days are part of the journey. The difference between those who succeed and those who give up is simply showing up, especially when you don't feel like it.",
        "Your fitness journey is unique to you, so stop comparing your beginning to someone else's middle. Focus on being better than you were yesterday. Track your progress, celebrate improvements, and remember that setbacks are just setups for comebacks. Your body will transform, but more importantly, your confidence and self-discipline will too.",
        "Physical strength and mental resilience go hand in hand. Every rep you complete builds not just muscle, but also character. When you challenge your body, you're simultaneously training your mind to overcome obstacles. Embrace the discomfort, as it's the gateway to growth and transformation that lasts far beyond the gym.",
        "Consistency in training creates compound results over time. A single workout won't transform your body, but showing up day after day will. Focus on building rituals and habits that support your goals rather than seeking quick fixes. Your future self will thank you for the discipline you show today.",
        "Your workout is an investment in your future health and well-being. Each session is a deposit in the bank of your physical capabilities. Don't shortchange yourself by skipping sessions or going through the motions. Give each workout your full effort, and you'll reap rewards that extend far beyond physical appearance."
    ],
    "Teacher": [
        "Learning is not a destination but a lifelong journey filled with discovery and growth. Every question you ask opens new doors to understanding, and every mistake you make is an opportunity to learn something valuable. Education is not about memorizing facts, but about developing critical thinking skills and nurturing curiosity that will serve you throughout your life.",
        "The most important quality a student can develop is not perfect grades, but resilience in the face of challenges. When you encounter difficult concepts, remember that struggle is part of the learning process. Embrace confusion as a stepping stone to clarity, and don't be afraid to ask for help when you need it. Your willingness to persist is what leads to true mastery.",
        "Knowledge is not meant to be hoarded but shared. When you help others understand something you've learned, you deepen your own understanding. Create study groups, engage in discussions, and explain concepts to your classmates. Teaching others is one of the most effective ways to solidify your own learning and build lasting friendships.",
        "Success in education requires a balance between discipline and creativity. Follow your curiosity, explore beyond required materials, and make connections between different subjects. The most interesting insights often come from unexpected places. Don't limit yourself to one way of thinking - embrace multiple perspectives and approaches to problem-solving.",
        "Remember that intelligence is not fixed but can be developed through effort and practice. When you face challenges that seem overwhelming, break them down into smaller, manageable steps. Celebrate small victories along the way, and don't be discouraged by temporary setbacks. Every expert was once a beginner, and every master was once a disaster.",
        "Education is not confined to classrooms or textbooks - it happens everywhere and all the time. Stay curious about the world around you, ask questions, and seek to understand how things work. Learning should be an adventure, not a chore. Embrace the joy of discovery and never stop exploring new ideas and concepts.",
        "The foundation of effective learning is active engagement with the material. Don't just passively consume information - interact with it, question it, and apply it. Take notes, ask questions, and make connections between new information and what you already know. The more actively you participate in your education, the more you'll retain and understand.",
        "Collaborative learning enhances individual understanding and builds essential social skills. Work with your peers, share ideas, and learn from different perspectives. Group discussions and projects not only deepen your understanding of the subject matter but also prepare you for real-world collaboration. Remember, we learn best when we learn together."
    ],
    "Chef": [
        "Cooking is an art form that combines creativity with technique, passion with precision. The best dishes are not just about following recipes, but understanding the why behind each step. When you know how ingredients interact and what each technique accomplishes, you gain the freedom to create your own culinary masterpieces with confidence and flair.",
        "Great cooking starts with great ingredients. Take time to source quality produce, understand seasonal availability, and build relationships with local suppliers. The difference between a good meal and an exceptional one often lies in the quality of the raw materials. Fresh, local ingredients require less manipulation to create something truly memorable.",
        "Flavor is built in layers, developed through patience and understanding. Don't rush the process - allow time for spices to bloom, sauces to reduce, and meats to rest. Each step in cooking has a purpose, and respecting those processes will elevate your dishes from simple meals to extraordinary experiences that delight all the senses.",
        "The kitchen is a place of experimentation and discovery. Don't be afraid to try new techniques, combine unexpected flavors, or adapt traditional recipes to suit your taste. Some of the best culinary innovations come from happy accidents and bold creativity. Keep tasting as you cook, adjusting and refining until each dish achieves perfect balance.",
        "Presentation matters as much as taste - we eat with our eyes first. Take time to plate your dishes thoughtfully, considering color, texture, and arrangement. A beautifully presented meal enhances the entire dining experience, turning simple nourishment into a celebration of creativity and craftsmanship.",
        "Mastering culinary skills requires practice, patience, and a willingness to learn from mistakes. Every failed dish is a learning opportunity, teaching you what not to do next time. Don't be discouraged by initial failures - they're stepping stones to culinary excellence. Embrace the journey of continuous improvement and savor the process.",
        "Understanding flavor profiles and how ingredients complement each other is essential for creating memorable dishes. Study the fundamentals of taste - sweet, salty, sour, bitter, and umami - and learn how to balance them. Experiment with herbs, spices, and seasonings to develop your palate and create unique flavor combinations.",
        "Cooking is both science and art, requiring technical knowledge and creative expression. Master the basics first - knife skills, cooking methods, and ingredient knowledge - then let your creativity flourish. Remember that great chefs are not born, but made through dedication, practice, and a passion for bringing joy to others through food."
    ]
}

def get_random_avatar():
    """随机选择一个人物"""
    return random.choice(list(AVATAR_VOICE_MAP.keys()))

def get_random_voice_for_avatar(avatar_name):
    """为指定人物随机选择一个语音"""
    if avatar_name in AVATAR_VOICE_MAP:
        return random.choice(AVATAR_VOICE_MAP[avatar_name]["voices"])
    return None

def get_random_script_for_avatar(avatar_name):
    """为指定人物随机选择一个文案"""
    print(avatar_name)
    print(SCRIPTS[avatar_name])
    if avatar_name in SCRIPTS:
        return random.choice(SCRIPTS[avatar_name])
    return None

def get_avatar_description(avatar_name):
    """获取人物描述"""
    if avatar_name in AVATAR_VOICE_MAP:
        return AVATAR_VOICE_MAP[avatar_name]["description"]
    return None